﻿using UnityEngine;

[System.Serializable]
public class LevelSave : ISaveObject
{
    [SerializeField] int currentLevelID;
    public int CurrentLevelID => currentLevelID;

    [SerializeField] ZoneSave[] zoneSaves;
    public ZoneSave[] ZoneSaves => zoneSaves;

    public LevelSave()
    {
        currentLevelID = 0;
        zoneSaves = null;
    }

    public LevelSave(int currentLevelID, Zone[] zones)
    {
        this.currentLevelID = currentLevelID;

        // Get save data from all zones
        zoneSaves = new ZoneSave[zones.Length];
        for (int i = 0; i < zones.Length; i++)
        {
            zoneSaves[i] = zones[i].Save();
        }
    }
}
